﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admins/Administrator.Master" AutoEventWireup="true" CodeBehind="User.aspx.cs" Inherits="WebBanHang.User" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="title">Quản Trị Người Dùng</div>
    <asp:Panel ID="pnShow" Width="100%" runat="server">
        <table id="table1" style="border-collapse:collapse; background-color:#D0DEF0;">
            <tr>
                <td>
                    <asp:Button ID="btnThem" runat="server" CssClass ="btnthem" Text="Thêm mới" 
                        onclick="btnThem_Click" />
                </td>
            </tr>
        </table>
        <asp:DataGrid ID="grdUser" runat="server" AllowPaging="True" 
            AutoGenerateColumns = "false" CellPadding="5" ForeColor="#333333" 
            Width="100%" 
            PageSize="10" onitemcommand="grdUser_ItemCommand" 
            OnPageIndexChanged="grdUser_PageIndexChanged">
            <AlternatingItemStyle Backcolor ="White"/>
            <HeaderStyle CssClass="trHeader" />
            <Columns>

                <asp:BoundColumn DataField ="UserName" HeaderText="Tài Khoản"></asp:BoundColumn>
                <asp:BoundColumn DataField ="Name" HeaderText="Tên Người Dùng"></asp:BoundColumn>
                <asp:BoundColumn DataField ="Rule" HeaderText="Quyền"></asp:BoundColumn>
                <asp:BoundColumn DataField ="Status" HeaderText="Trạng Thái"></asp:BoundColumn>

                <asp:TemplateColumn>
                    <HeaderTemplate>Chức Năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lbt1" CommandArgument ='<%#DataBinder.Eval(Container.DataItem,"Id") %>' CommandName="Edit" CssClass="edit" ToolTip="Sửa" />
                        <asp:LinkButton runat="server" ID="lbt2" CommandArgument ='<%#DataBinder.Eval(Container.DataItem,"Id") %>' CommandName="Delete" CssClass="delete" ToolTip="Xoá" OnClientClick="return confir(Bạn có chắc chắn không ?)" />
                    </ItemTemplate>
                </asp:TemplateColumn>

            </Columns>
            <EditItemStyle BackColor="#2461BF" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="true" ForeColor="White" />
            <ItemStyle BackColor="#EFF3FB" />
            <PagerStyle BackColor="#F3F8FE" Font-Bold="true" ForeColor="Blue" HorizontalAlign="Center" Mode="NumericPages" />
            <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="true" ForeColor="#33333" />            
        </asp:DataGrid>
    </asp:Panel>
    <asp:Panel ID="pnUpdate" runat="server" Visible="False">
        <table id="table2" style="border-collapse:collapse;"cellpadding="0" width="100%" border="0" >
            <tr>
                <td width ="150" class="name_fild_row">
                    <asp:Label ID="Label1" Text="Tên Đăng Nhập" runat="server"/>
                </td>
                <td>
                    <asp:TextBox ID="txtUserName" runat="server" />
                    <asp:TextBox ID="txtID" runat="server" Visible="false" />
                </td>
            </tr>
            <tr>                
                <td width ="150" class="name_fild_row">
                    <asp:Label ID="Label2" Text="Mât Khẩu" runat="server"/>
                </td>
                <td>
                    <asp:TextBox ID="txtPassword" runat="server" />
                </td>
            </tr>
            <tr>                
                <td width ="150" class="name_fild_row">
                    <asp:Label ID="Label5" Text="Tên Người Dùng" runat="server"/>
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" />
                </td>
            </tr>
            <tr>
                <td width ="150" class="name_fild_row">
                    <asp:Label ID="Label3" Text="Quyền Hạn" runat="server"/>
                </td>
                <td>
                    <asp:DropDownList ID="ddRole" runat="server">
                        <asp:ListItem Value="1">Admin</asp:ListItem>
                        <asp:ListItem Value="2">User</asp:ListItem>
                    </asp:DropDownList>
                </td>
                

            </tr>
            <tr>
                <td width ="150" class="name_fild_row">
                    <asp:Label ID="Label4" Text="Trạng Thái" runat="server"/>
                </td>
                <td>
                    <asp:DropDownList ID="ddStatus" runat="server">
                        <asp:ListItem Value="1">Sử Dụng</asp:ListItem>
                        <asp:ListItem Value="2">Cấm Sử Dụng</asp:ListItem>
                    </asp:DropDownList>
                </td>              

            </tr>
            <tr>                
                <td width ="150" class="name_fild_row">
                    
                </td>
                <td>
                    <asp:LinkButton ID="lbtUpdate" runat="server" CssClass="update" 
                        onclick="lbtUpdate_Click">Cập nhật</asp:LinkButton>
                     <asp:LinkButton ID="lbtBack" runat="server" CssClass="back" 
                        onclick="lbtBack_Click">Trở Lại</asp:LinkButton>
                </td>
                
            </tr>
        </table>
    </asp:Panel>
</asp:Content>

